/**
 * 地图随玩家移动
 * author: suyuyi
 * date:    2017-4-5
 */
cc.Class({
    extends: cc.Component,

    properties: {
        
    },

    // use this for initialization
    onLoad: function () {
        this.map = cc.find("background", this.node.parent);
        
        this.node.on("position-changed", function(event){   //??????
            this.map.x = - event.currentTarget.x;
            this.map.y = - event.currentTarget.y;
        },this);
    },
    
    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {
        
    // },
});
